<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<meta name="description" content="">
	<meta name="author" content="">

	<title>后台管理</title>
	<!-- Bootstrap core CSS -->
	<link th:href="@{/webjars/bootstrap/4.4.1-1/css/bootstrap.css}" rel="stylesheet">

	<link th:href="@{/asserts/css/dashboard.css}" rel="stylesheet">
	<link th:href="@{/iconfont/iconfont.css}" rel="stylesheet">
	<style type="text/css">

		@-webkit-keyframes chartjs-render-animation {
			from {
				opacity: 0.99
			}
			to {
				opacity: 1
			}
		}

		@keyframes chartjs-render-animation {
			from {
				opacity: 0.99
			}
			to {
				opacity: 1
			}
		}

		.info{
			float: left;
		}
		.pagination{
			float:right;
		}
	</style>
</head>

<body>
<!--引入抽取的topbar-->
<!--模板名：会使用thymeleaf的前后缀配置规则进行解析-->
<div th:replace="commons/bar::topbar"></div>

<div class="container-fluid">
	<div class="row">
		<!--引入侧边栏-->
		<div th:replace="commons/bar::#sidebar(activeUri='salaryaccounts')"></div>

		<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
			<h2><a class="btn btn-success" href="salaryaccount" th:href="@{/salaryaccount}">添加</a></h2>
			<div class="table-responsive">
				<table class="table table-striped table-sm table-bordered">
					<thead>
					<tr>
						<th>薪酬标准编号</th>
						<th>薪酬标准名称</th>
						<th>审核状态</th>
						<th>更新时间</th>
						<th>操作</th>
					</tr>
					</thead>
					<tbody>
					<tr th:each="salaryaccount:${pageInfo.list}">
						<td>[[${salaryaccount.id}]]</td>
						<td>[[${salaryaccount.name}]]</td>
						<td>[[${salaryaccount.state}]]</td>
						<td>[[${#dates.format(salaryaccount.updatetime, 'yyyy-MM-dd')}]]</td>
						<td>
							<a class="btn btn-info" th:href="@{/salaryaccount/}+${salaryaccount.id}">编辑</a>
							<a class="btn btn-info" th:href="@{/getsalaryaccount/}+${salaryaccount.id}">明细</a>
							<button th:attr="del_uri=@{/salaryaccount/}+${salaryaccount.id}" class="btn btn-warning deleteBtn">删除</button>
						</td>
					</tr>
					</tbody>
				</table>

				<p class="info">
					当前第 <span th:text="${pageInfo.pageNum}"></span> 页,总共 <span
						th:text="${pageInfo.pages}"></span> 页,共 <span
						th:text="${pageInfo.total}"></span> 条记录
				</p>
				<ul class="pagination">
					<li class="page-item"><a class="page-link" th:href="@{/salaryaccounts}">首页</a> </li>
					<li class="page-item"><a class="page-link" th:href="@{/salaryaccounts(pageNum=${pageInfo.hasPreviousPage}?${pageInfo.prePage}:1)}">上一页</a></li>
					<li class="page-item"><a class="page-link" th:href="@{/salaryaccounts(pageNum=${pageInfo.hasNextPage}?${pageInfo.nextPage}:${pageInfo.pages})}">下一页</a></li>
					<li class="page-item"><a class="page-link" th:href="@{/salaryaccounts(pageNum=${pageInfo.pages})}">尾页</a></li>
				</ul>
			</div>
		</main>
		<form id="deleteSalaryAccountForm" method="post">
			<input type="hidden" name="_method" value="delete"/>
		</form>
	</div>
</div>

<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" th:src="@{/webjars/jquery/3.5.0/jquery.js}"></script>
<script type="text/javascript" th:src="@{/webjars/popper.js/1.14.3/popper.js}"></script>
<script type="text/javascript" th:src="@{/webjars/bootstrap/4.4.1-1/js/bootstrap.js}"></script>

<script>
	$(".deleteBtn").click(function(){
		//删除当前
		$("#deleteSalaryAccountForm").attr("action",$(this).attr("del_uri")).submit();
		return false;
	});
</script>
</body>
</html>